Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pages] Update bindings section of Qwik framework guide #12915

Closed
wants to merge 1 commit into from

Conversation

jculvey
Copy link
Contributor

@jculvey jculvey commented Feb 9, 2024

This change adds more detail to the bindings section of the Qwik framework guide on how to configure bindings in dev and production. It covers the recent addition of getBindingsProxy to the qwik template in c3: cloudflare/workers-sdk#4927.

A few of the sections were re-ordered to bring the page in line with the proposed updates to the Next.js framework guide: #12707

@jculvey jculvey changed the title Update bindings section of Qwik framework guide [Pages] Update bindings section of Qwik framework guide Feb 13, 2024

### Deploy via the Cloudflare dashboard
You can instead [connect a GitHub or Gitlab repository](/pages/configuration/git-integration) to your Pages project so that new versions of your project are built and deployed when changes to your git repository are detected. To do so, choose “No” when C3 asks if you’d like to deploy and refer to the guide below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Next.js guide we went quite a different direction in regards to the git integration:

{{<Aside type="note" header="Git integration">}}
The initial deployment created via C3 is referred to as a [Direct Upload](/pages/get-started/direct-upload/). To set up a deployment via the Pages Git integration, refer to the [Git Integration](#git-integration) section below.
Git integration cannot currently be added to existing Pages applications. If you have already deployed your application (using C3, for example), you need to create a new Pages application in order to add Git integration to it.
{{</Aside>}}

I think we should be consistent and use the Next.js version (which is the one the team agreed on I think)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I can see the same sort of note below... but I think that this version is more confusing then the Next.js one since here we say "instead" and tell people to say "No" to the C3 deployment, and only later we mention the option to create a new Pages project. 🤔

Copy link

cloudflare-workers-and-pages bot commented Feb 13, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d3de783
Status: ✅  Deploy successful!
Preview URL: https://4114b86a.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://jculvey-qwik-bindings-update.cloudflare-docs-7ou.pages.dev

View logs

Comment on lines +108 to +112
if(process.env.NODE_ENV === 'development') {
const { getBindingsProxy } = await import('wrangler');
const { bindings } = await getBindingsProxy();
env = bindings;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since #12957 got merged:

Suggested change
if(process.env.NODE_ENV === 'development') {
const { getBindingsProxy } = await import('wrangler');
const { bindings } = await getBindingsProxy();
env = bindings;
}
if(process.env.NODE_ENV === 'development') {
const { getPlatformProxy } = await import('wrangler');
const platformProxy = await getBindingsProxy();
env = platformProxy.env;
}

(following what I did in cloudflare/workers-sdk#5010)

});
```

The `getBindingsProxy` [helper function](/workers/wrangler/api#getbindingsproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`.
Copy link
Member

@dario-piotrowicz dario-piotrowicz Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since #12957 got merged:

Suggested change
The `getBindingsProxy` [helper function](/workers/wrangler/api#getbindingsproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`.
The `getPlatformProxy` [helper function](/workers/wrangler/api#getplatformproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`.

@KimJ15
Copy link
Collaborator

KimJ15 commented Sep 27, 2024

👋Hi there, we’re going to close this PR due to inactivity

@KimJ15 KimJ15 closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants